Skip to content

Conversation

@theblixguy
Copy link
Collaborator

Currently, when we return from a Void-returning function, an error is emitted:

func voidFunc() {
  return 0 // error: unexpected non-void return value in void function
}

It's likely that the user forgot to add a return type, so add a fix-it to insert a placeholder for the type.

@theblixguy theblixguy requested a review from xedin February 10, 2020 23:15
The function name will be empty in some cases, for example for property setters. In cases where the function name is empty, skip the note and fix-it.
@theblixguy
Copy link
Collaborator Author

@swift-ci please smoke test

@xedin
Copy link
Contributor

xedin commented Feb 11, 2020

@theblixguy Let's hold off from triggering CI for now, it would have to be re-triggered after LLVM changes are done anyway.

@theblixguy
Copy link
Collaborator Author

@swift-ci please smoke test

@theblixguy theblixguy merged commit 2113940 into swiftlang:master Feb 11, 2020
@theblixguy theblixguy deleted the chore/add-non-void-fix-it branch February 11, 2020 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants